home *** CD-ROM | disk | FTP | other *** search
/ PC Direct 1998 August / PC Direct August 1998.iso / S / powerj / Product / hpp.z / WCONTROL.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-25  |  5.7 KB  |  194 lines

  1. /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2.    %     Copyright (C) 1994, by WATCOM International Inc.  All rights    %
  3.    %     reserved.  No part of this software may be reproduced or        %
  4.    %     used in any form or by any means - graphic, electronic or       %
  5.    %     mechanical, including photocopying, recording, taping or        %
  6.    %     information storage and retrieval systems - except with the     %
  7.    %     written permission of WATCOM International Inc.                 %
  8.    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  9. */
  10.  
  11. /*************************************************************************
  12.  *
  13.  * WControl
  14.  *
  15.  *
  16.  *   Events:
  17.  *
  18.  *       Scroll --
  19.  *
  20.  *************************************************************************/
  21.  
  22. #ifndef _WCONTROL_HPP_INCLUDED
  23. #define _WCONTROL_HPP_INCLUDED
  24. #pragma once
  25.  
  26. #ifndef _WNO_PRAGMA_PUSH
  27. #pragma pack(push,8);
  28. #pragma enum int;
  29. #endif
  30.  
  31. #ifndef _WWINDOW_HPP_INCLUDED
  32. #  include "wwindow.hpp"
  33. #endif
  34.  
  35. //
  36. // Control styles
  37. //
  38.  
  39. #define WCCSTop                 ((WStyle)0x00000001L) // CCS_TOP
  40. #define WCCSNoMoveY             ((WStyle)0x00000002L) // CCS_NOMOVEY
  41. #define WCCSBottom              ((WStyle)0x00000003L) // CCS_BOTTOM
  42. #define WCCSNoResize            ((WStyle)0x00000004L) // CCS_NORESIZE
  43. #define WCCSNoParentAlign       ((WStyle)0x00000008L) // CCS_NOPARENTALIGN
  44. #define WCCSAdjustable          ((WStyle)0x00000020L) // CCS_ADJUSTABLE
  45. #define WCCSNoDivider           ((WStyle)0x00000040L) // CCS_NODIVIDER
  46.  
  47. enum WTextJustification {
  48.     WAliLeft,
  49.     WTJCenter,
  50.     WTJRight
  51. };
  52.  
  53. enum WVTextJustification {
  54.     WVTJTop,
  55.     WVTJCenter,
  56.     WVTJBottom
  57. };
  58.  
  59. struct WScrollBarEventData;
  60.  
  61. class WCMCLASS WControl : public WWindow {
  62.     WDeclareSubclass( WControl, WWindow );
  63.     
  64.     public:
  65.  
  66.         /**************************************************************
  67.          * Constructors and destructors
  68.          **************************************************************/
  69.  
  70.         WControl();
  71.  
  72.     protected:
  73.  
  74.         WControl( WWindow * parent, WWindowHandle hdl );
  75.  
  76.     public:
  77.  
  78.         ~WControl();
  79.     
  80.         /**************************************************************
  81.          * Properties
  82.          **************************************************************/
  83.  
  84.         // DeferResizePercentages
  85.  
  86.         WBool GetDeferResizePercentages() const;
  87.         WBool SetDeferResizePercentages( WBool deferResizePercentages );
  88.  
  89.         // FDXModified
  90.  
  91.         WBool SetFDXModified( WBool modified ); // WCMINLINE
  92.         WBool GetFDXModified() const; // WCMINLINE
  93.  
  94.         // FDXModifiedPointer
  95.  
  96.         WBool SetFDXModifiedPointer( WBool * fdxModified ); // WCMINLINE
  97.  
  98.         // NextControlInGroup
  99.  
  100.         WControl *GetNextControlInGroup() const;
  101.  
  102.         // ResizePercentages
  103.  
  104.         WRect GetResizePercentages() const; // WCMINLINE
  105.         WBool SetResizePercentages( const WRect & resizePercentages );
  106.  
  107.         // TabGroup
  108.  
  109.         WBool SetTabGroup( WBool tabGroup );
  110.         WBool GetTabGroup() const;
  111.  
  112.         // TabStop
  113.  
  114.         WBool SetTabStop( WBool tabStop );
  115.         WBool GetTabStop() const;
  116.  
  117.         /**************************************************************
  118.          * Methods
  119.          **************************************************************/
  120.  
  121.         // FDXIn
  122.  
  123.         virtual WBool FDXIn();
  124.  
  125.         // FDXOut
  126.  
  127.         virtual WBool FDXOut();
  128.  
  129.         /**************************************************************
  130.          * Event Handlers
  131.          **************************************************************/
  132.  
  133.         WBool ControlColorEventHandler( WControl * control,
  134.                                         WMessageEventData * event );
  135.  
  136.         WBool DestroyEventHandler( WControl * control, WEventData * event );
  137.  
  138.         /**************************************************************
  139.          * Overrides
  140.          **************************************************************/
  141.  
  142.         virtual WBool LoadWindow( WWindow * parent,
  143.                                   const WResourceID & id,
  144.                                   WModuleHandle module=_ApplicationModule );
  145.  
  146.         virtual WBool MakeWindow( WWindow * parent, WUInt id,
  147.                                   const WChar * className,
  148.                                   const WChar * title, const WRect & r,
  149.                                   WStyle wstyle, WStyle exStyle,
  150.                                   void * data=NULL );
  151.  
  152.         /**************************************************************
  153.          * Other
  154.          **************************************************************/
  155.  
  156.         WRect GetPendingResizePercentages() const; // WCMINLINE
  157.         WBool SetPendingResizePercentages( const WRect & pendingResizePercentages ); // WCMINLINE
  158.  
  159.         virtual WBool SetParent( const WWindow * parent );
  160.  
  161.         virtual WBool RedirectChildInput();
  162.  
  163.         virtual int operator ==( const WControl & obj ) const;
  164.  
  165.         static WBool InitializeCommonControls();
  166.  
  167.         /**************************************************************
  168.          * Data members
  169.          **************************************************************/
  170.  
  171.     private:
  172.  
  173.         WBool *         _fdxModified;
  174.         WRect           _resizePercentages;
  175.         WRect           _pendingResizePercentages;
  176.         WBool           _deferResizePercentages;
  177. };
  178.  
  179. #ifdef WCM_ENABLE_INLINES
  180.   #ifndef WCM_NO_WCONTROL_INLINES
  181.     #define WCMINLINE inline
  182.     #include "wcontrol.inl"
  183.   #endif
  184. #endif
  185.  
  186. extern template WVector<WControl>;
  187.  
  188. #ifndef _WNO_PRAGMA_PUSH
  189. #pragma enum pop;
  190. #pragma pack(pop);
  191. #endif
  192.  
  193. #endif // _WCONTROL_HPP_INCLUDED
  194.